/**
 * Uploaded image model
 */
export interface UploadedImage {
  id: string;           // Unique identifier
  file: File;           // Original file object
  url: string;          // Object URL for display
  name: string;         // Original filename
  width: number;        // Image width in pixels
  height: number;       // Image height in pixels
  fileSize: number;     // File size in bytes
  format: string;       // Image format (jpg, png, etc.)
}

/**
 * Stitching options model
 */
export interface StitchingOptions {
  arrangement: 'grid' | 'horizontal' | 'vertical' | 'dynamic';  // How to arrange images
  spacing: number;                                  // Spacing between images in pixels
  maxWidth: number;                                 // Maximum width of stitched image
  maxHeight: number;                                // Maximum height of stitched image
  backgroundColor: string;                          // Background color
  allowRotation?: boolean;                          // Whether to allow image rotation for better layout
  targetSize?: number;                              // Target size for dynamic layout (e.g., 12000)
}

/**
 * Stitched image model
 */
export interface StitchedImage {
  id: string;           // Unique identifier
  canvas: HTMLCanvasElement;  // Canvas element containing the stitched image
  width: number;        // Width of stitched image
  height: number;       // Height of stitched image
  url: string;          // Object URL for display
}

/**
 * Image position in stitched image
 */
export interface ImagePosition {
  id: string;           // Unique identifier matching the original image
  name: string;         // Original filename
  x: number;            // X position in stitched image
  y: number;            // Y position in stitched image
  width: number;        // Width in stitched image
  height: number;       // Height in stitched image
  format: string;       // Original format
  rotated?: boolean;    // Whether the image is rotated 90 degrees
  originalWidth?: number; // Original width before rotation
  originalHeight?: number; // Original height before rotation
}

/**
 * Image metadata model
 */
export interface ImageMetadata {
  version: string;      // Metadata version for compatibility
  timestamp: number;    // Unix timestamp of when stitching occurred
  stitchedImageSize: {
    width: number;
    height: number;
  };
  backgroundColor: string;  // Background color used
  images: ImagePosition[];  // Array of image positions
}

/**
 * Restored image model
 */
export interface RestoredImage {
  id: string;           // Unique identifier
  name: string;         // Original filename
  canvas: HTMLCanvasElement;  // Canvas element containing the restored image
  width: number;        // Width of restored image
  height: number;       // Height of restored image
  url: string;          // Object URL for display
  format: string;       // Image format
}